from selenium.webdriver.common.by import By

from base.page_base import BasePage
from config import  BACK_URL
from config import *

class BackLogin(BasePage):
    username=(By.ID,'username')
    password=(By.ID,'password')
    valicode=(By.ID,'valicode')
    login_button=(By.CLASS_NAME,'login-button')
    def open_url(self):
        self.driver.get(BACK_URL)
    def input_username(self,username):
        self.base_input(self.username,username)
    def input_password(self,password):
        self.base_input(self.password,password)
    def input_valicode(self,valicode):
        self.base_input(self.valicode,valicode)
    def click_button(self):
        self.base_click(self.login_button)
    def back_login(self,username=USERNAME,password=PASSWORD,valicode=VALICODE):
        self.input_username(username)
        self.input_password(password)
        self.input_valicode(valicode)
        self.click_button()
